//
// Created by qzj on 2021/11/3.
//

#ifndef SRC_IPMANAGER_H
#define SRC_IPMANAGER_H

#include <opencv2/core.hpp>
#include <opencv2/opencv.hpp>
#include <cv_bridge/cv_bridge.h>
#include "tools/tic_toc.hpp"
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/CameraInfo.h>
#include <ros/ros.h>
#include "sensor_data/four_images_data.hpp"

namespace avp_slam {
    class IPManager {
    public:
        IPManager(ros::NodeHandle &nh);

        cv::Mat DoIPM(const FourImagesData &fourImagesData);

        cv::Mat Concat(const FourImagesData &fourImagesData);

        void partIPM(const cv::Mat &K_ivt, cv::Mat &IPM, const cv::Mat &color, float rotation_z);

        void cmrInfoCallback(const sensor_msgs::CameraInfoConstPtr &cmr_info);

    private:
        ros::NodeHandle nh_;
        ros::Subscriber camera_info_;
        cv::Mat K;
//        测量耗时
        std::shared_ptr<TicToc> time_ipm0;
        std::string ipm_save_dir;

    };
}

#endif //SRC_IPMANAGER_H
